Skip to content

chore: guard lint-staged pre-commit hook - #1151

Merged
ogazboiz merged 2 commits into
LabsCrypt:mainfrom
CleanDev-Fix:infra/1077-lint-staged-guard
Aug 3, 2026
Merged

chore: guard lint-staged pre-commit hook#1151
ogazboiz merged 2 commits into
LabsCrypt:mainfrom
CleanDev-Fix:infra/1077-lint-staged-guard

Conversation

@CleanDev-Fix

Copy link
Copy Markdown
Contributor

Summary

Make the pre-commit hook fail clearly when lint-staged is not installed locally.

Changes

  • Guard the repository-local lint-staged executable before invocation.
  • Direct contributors to run npm install when it is missing.
  • Invoke the local executable directly, avoiding npx package resolution.
  • Leave the existing lint-staged scope unchanged.

Testing / Verification

  • sh -n .husky/pre-commit
  • Isolated missing-binary scenario: exact guidance message and exit 1.
  • Isolated present-binary scenario with npx unavailable: local binary
    invoked and exit 0.
  • Isolated failing-binary scenario: exit status propagated.
  • git diff --check

Related issue: #1077

@ogazboiz ogazboiz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right fix for #1077: checking for the local binary and failing with an actionable npm install message beats silently fetching an arbitrary lint-staged. path is correct for a root devDependency. merging. if you want to keep contributing, join us on Telegram: https://t.me/+DOylgFv1jyJlNzM0

@ogazboiz
ogazboiz marked this pull request as ready for review August 3, 2026 23:17
@ogazboiz
ogazboiz merged commit 018efa5 into LabsCrypt:main Aug 3, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants